package jdkDemo;

import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Test3 {
	public static void main(String[] args) {
		String re = "^[1-9]\\d{16}[0-9X]$|^[1-9]\\d{14}$";
		
		String re2 = "(^19\\d{2})|(^200\\d)|(^201[0-7])[-/]?(0?[1-9]|1[0-2])[-/]?((0[1-9])|([12][0-9])|(3[0-1]))$";
		
		String string = "2000-12-09";
		Pattern pattern = Pattern.compile(re2);
		Matcher matcher = pattern.matcher(string);
		while(matcher.find())
			System.out.println(matcher.start()+"..."+matcher.end()+"..."+matcher.group());
		
		
		
	}

}
